num = int(input())
hexStr = ""
while num != 0:
    mod = num % 16
    if mod < 10:
        hexStr = str(mod) + hexStr
    else:
        hexStr = str(chr(mod - 10 + ord('a'))) + hexStr
    num //= 16
print(hexStr)